//
//  UIBarButtonItem+Extension.swift
//  SwiftSina
//
//  Created by Jason Ding on 16/8/17.
//  Copyright © 2016年 Jason Ding. All rights reserved.
//

import UIKit

extension UIBarButtonItem {
    /**
     利用图片名称,创建Item
     */
    convenience init(imageName:String) {
        let btn = UIButton()
        btn.setImage(UIImage(named:imageName ), forState: .Normal)
        btn.setImage(UIImage(named:imageName + "_highlighted" ), forState: .Highlighted)
        btn.sizeToFit()
        
        self.init(customView:btn)
    }
}
